/**
 * 
 */
package com.cms.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cms.pojo.User;
import com.cms.service.UserService;
import com.github.pagehelper.PageInfo;

/**
 * @author zhaoyan
 *
 * 2020年1月8日
 */
@Controller
@RequestMapping("show")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	
	@RequestMapping("findUser")
	public String showUser(HttpServletRequest request, @RequestParam(defaultValue = "1")Integer pageNum){
		
		PageInfo<User> showUser = userService.showUser(pageNum);
		
		System.out.println(pageNum);
		
		request.setAttribute("userPage", showUser);
		
		return "show/userlist";
	}
	
	@RequestMapping("changeStatus")
	@ResponseBody
	public Integer changeSta(String uid,String flag) {
		
		return userService.changeStu(uid,flag);
		
	}

}
